<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html class="panel-fit">
<head>
    <title>老司机车险</title>
    <style>
        .menuWidth {
            width: 220px !important;
        }
    </style>
    <jsp:include page="common/common.jsp"></jsp:include>
    <!--第三方插件加载-->
    <script src="/static/js/plugins/plugin/justgage-1.2.2/raphael-2.1.4.min.js"></script>
    <script src="/static/js/plugins/plugin/justgage-1.2.2/justgage.js"></script>
    <script src="/static/js/plugins/plugin/Highcharts-5.0.0/js/highcharts.js"></script>
    <script type="text/javascript" src="/static/js/plugins/plugin/ueditor-1.4.3.3/ueditor.config.js"></script>
    <script type="text/javascript" src="/static/js/plugins/plugin/ueditor-1.4.3.3/ueditor.all.min.js"></script>
    <link href="/static/js/plugins/plugin/cropper-2.3.4/dist/cropper.min.css" rel="stylesheet" type="text/css">
    <%--<link href="/static/css/hover-effects.css" rel="stylesheet" type="text/css">--%>
    <script src="/static/js/plugins/plugin/cropper-2.3.4/dist/cropper.min.js"></script>
    <script>
        $.extend($.fn.validatebox.defaults.rules, {
            equals: {
                validator: function (value, param) {
                    return value == $(param[0]).val();
                },
                message: '两次输入的密码不一致'
            }
        });
    </script>
    <!--第三方插件加载结束-->
    <script type="text/javascript" src="/static/js/system/main.js"></script>
    <script>
        $(function () {
            //顶部修改员工弹出框对象
            /*布局部分*/
            $('#master-layout').layout({
                fit: true/*布局框架全屏*/
            });
            /*右侧菜单控制部分*/
            $(".passwordbox-open").css("width", "30px");
            var left_control_status = true;
            var left_control_panel = $("#master-layout").layout("panel", 'west');

            $(".left-control-switch").on("click", function () {
                if (left_control_status) {
                    left_control_panel.panel('resize', {width: 70});
                    left_control_status = false;
                    $(".theme-left-normal").hide();
                    $(".theme-left-minimal").show();
                } else {
                    left_control_panel.panel('resize', {width: 200});
                    left_control_status = true;
                    $(".theme-left-normal").show();
                    $(".theme-left-minimal").hide();
                }
                $("#master-layout").layout('resize', {width: '100%'})
            });
        });
        /*搜索框改变主页内容*/
        var icons;

        function doSearch(value) {
            $.post("/menu/subMenu.do", {keyword: value}, function (data) {
                icons = data;
                if (!$("#tabs").tabs("exists", '主页')) {
                    $("#tabs").tabs("add", {
                        title: '主页',
                        content: '<iframe src="/homepage/masterpage.do" frameborder="0" style="width:100% ; height: 100%;"></iframe>',
                        closable: true
                    })
                } else {
                    $("#tabs").tabs("select", "主页");
                    reload();
                }
            })
        }
    </script>
    <script type="text/javascript">
        function logout() {
            window.location.href = 'logout.do';
        }
    </script>
    <%--点击菜单跳转--%>
    <script>
        function openClientTab() {
            var text = '未指派客户'
            var url = '/client/moveAll_view.do'
            getTab(text, url);
        }

        function openOrderTab() {
            var text = '待审核单'
            var url = '/insuranceTS/listPrepare.do'
            getTab(text, url);
        }

        function openDealTab() {
            var text = '未处理报案'
            var url = '/accident/list.do'
            getTab(text, url);
        }

        function openPaidTab() {
            var text = '保单缴费'
            var url = '/payment/list.do'
            getTab(text, url);
        }

        function getTab(text, url) {
            if (!$("#tabs").tabs("exists", text)) {
                $("#tabs").tabs("add", {
                    title: text,
                    content: '<iframe src=' + url + ' width=100% height=100% frameborder=0></iframe>',
                    closable: true
                })
            } else {
                $("#tabs").tabs("select", text);
            }
        }
    </script>
</head>
<body>
<div id="master-layout">
    <div data-options="region:'north',border:false,bodyCls:'theme-header-layout'">
        <div class="theme-navigate">
            <div class="left">
                <a href="#" class="easyui-linkbutton left-control-switch">
                    <img src="/static/js/plugins/themes/insdep/images/navigate_more.png"></a>
                <a href="#" class="easyui-menubutton theme-navigate-user-button"
                   data-options="menu:'.theme-navigate-user-panel'"><shiro:principal property="realname"/></a>
                <%--消息提示--%>
                <a href="#" class="easyui-menubutton" data-options="menu:'#mm3',hasDownArrow:false">待办
                    <span class="badge color-important" id="totalMsg">0</span>
                </a>
                <div id="mm3" class="theme-navigate-menu-panel" style="width:180px;">
                    <div onclick="openClientTab()">资源池客户<span class="badge color-important"
                                                              id="totalUnsignClient">0</span></div>
                    <div onclick="openOrderTab()">待处理保单<span class="badge color-important"
                                                             id="totalUndealOrder">0</span></div>
                    <div onclick="openDealTab()">待理赔保单<span class="badge color-important"
                                                            id="totalUndealAccident">0</span></div>
                    <div onclick="openPaidTab()">待处理支付<span class="badge color-important" id="totalUnpaidOrder">0</span>
                    </div>
                </div>


                <div class="theme-navigate-user-panel">
                    <dl>
                        <dd>
                            <img src="/static/js/plugins/themes/insdep/images/portrait86x86.png" width="86" height="86">
                            <b class="badge-prompt"><shiro:principal property="realname"/></b>
                            <span><shiro:principal property="email"/></span>
                        </dd>
                        <dt>
                            <a class="theme-navigate-user-modify">修改资料</a>
                            <a class="theme-navigate-user-logout" onclick="logout()">注销</a>
                        </dt>
                    </dl>
                </div>
            </div>
            <div class="right">
                <input class="easyui-searchbox theme-navigate-search"
                       data-options="prompt:'输入搜索的关键词..',searcher:doSearch" style="width:300px"></input>
            </div>
        </div>

    </div>

    <!--开始左侧菜单-->
    <div data-options="region:'west',border:false,bodyCls:'theme-left-layout'" style="width:200px;">

        <!--正常菜单-->
        <div class="theme-left-normal">
            <!--start class="easyui-layout"-->
            <div class="easyui-layout" data-options="border:false,fit:true">
                <!--start region:'north'-->
                <div data-options="region:'north',border:false" style="height:100px;">
                    <!--start theme-left-user-panel-->
                    <div class="theme-left-user-panel">
                        <dl>
                            <dt>
                                <img src="/static/js/plugins/themes/insdep/images/portrait86x86.png" width="43"
                                     height="43">
                            </dt>
                            <dd>
                                <b class="badge-prompt"><shiro:principal property="realname"/>
                                </b>
                                <p/>
                                <hr/>
                                <p/>
                                <span><shiro:principal property="email"/></span>
                            </dd>

                        </dl>
                    </div>
                    <!--end theme-left-user-panel-->
                </div>
                <!--end region:'north'-->

                <!--start region:'center'-->
                <div data-options="region:'center',border:false">

                    <!--start easyui-accordion-->
                    <div class="easyui-accordion" data-options="border:false,fit:true" id="menuAcc">
                        <div title="客户管理" data-id="7">
                            <ul class="easyui-datalist" data-options="border:false,fit:true">
                                <input type="hidden" value="7" class="menuId">
                            </ul>
                        </div>
                        <div title="保单管理" data-id="8">
                            <ul class="easyui-datalist" data-options="border:false,fit:true">
                                <input type="hidden" value="8" class="menuId">
                            </ul>
                        </div>
                        <div title="见费出单" data-id="22">
                            <ul class="easyui-datalist" data-options="border:false,fit:true">
                                <input type="hidden" value="9" class="menuId">
                            </ul>
                        </div>
                        <div title="理赔管理" data-id="9">
                            <ul class="easyui-datalist" data-options="border:false,fit:true">
                                <input type="hidden" value="9" class="menuId">
                            </ul>
                        </div>
                        <div title="信息管理" data-id="10">
                            <ul class="easyui-datalist" data-options="border:false,fit:true">
                                <input type="hidden" value="10" class="menuId">
                            </ul>
                        </div>
                        <div title="系统管理" data-id="1">
                            <ul class="easyui-datalist" data-options="border:false,fit:true">
                                <input type="hidden" value="1" class="menuId">
                            </ul>
                        </div>
                    </div>
                    <!--end easyui-accordion-->

                </div>
                <!--end region:'center'-->
            </div>
            <!--end class="easyui-layout"-->

        </div>
        <!--最小化菜单-->
        <div class="theme-left-minimal">
            <ul class="easyui-datalist" data-options="border:false,fit:true">
                <li><a class="left-control-switch">
                    <img src="/static/js/plugins/themes/insdep/images/open.png"/>
                    <p>打开</p></a></li>
            </ul>
        </div>

    </div>
    <!--结束左侧菜单-->

    <div data-options="region:'center',border:false" id="control">
        <div id="tabs" class="easyui-tabs" data-options="tools:'#tab-tools'" fit="true">
            <div title="主页" closable="true">
                <script>
                    doSearch('');
                </script>
                <iframe src="/homepage/masterpage.do" frameborder="0" style="width:100% ; height: 100%;"></iframe>
                <iframe src="/homepage/timeUI.do" frameborder="0" style="width:100% ; height: 100%;"></iframe>
            </div>

        </div>
    </div>
    <div id="tab-tools">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'"
           onclick="addPanel()"></a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-remove'"
           onclick="removePanel()"></a>
    </div>

    <div id="tab_menu" class="easyui-menu" style="width:120px;">
        <div data-options="iconCls:'icon-reload'" onclick="reload()">刷新当前面板</div>
        <div data-options="iconCls:'icon-cancel'" onclick="removePanel()">关闭当前面板</div>
        <div data-options="iconCls:'icon-cancel'" onclick="closeAll()">关闭所有面板</div>
    </div>
</div>

<div id="emp_dialog">
    <form id="emp_form" method="post" style="margin-top: 20px">
        <table style="margin: 0 auto">
            <input type="hidden" name="id" value="<shiro:principal property='id'/>">
            <%--            <tr>
                            <td><input label="用户名" type="text" class="easyui-textbox" name="username"
                                       value="<shiro:principal property='username'/>"
                                       style="width: 250px;" labelWidth="90px"></td>
                        </tr>--%>
            <%--<tr>
                <td><input label="真实姓名" type="text" class="easyui-textbox" name="realname"
                           value="<shiro:principal property='realname'/>"
                           style="width: 250px;" labelWidth="90px"></td>
            </tr>--%>
            <tr id="emp_oldpassword">
                <td><input label="原密码" type="text" class="easyui-passwordbox" name="oldpassword"
                           style="width: 250px;" labelWidth="90px" prompt="请输入原密码"
                           data-options="required:'true'"></td>
            </tr>
            <tr>
                <td><input id="emp_password" label="新密码" type="text" class="easyui-passwordbox" name="password"
                           style="width: 250px;" labelWidth="90px" prompt="请输入新密码"
                           data-options="required:'true'"></td>
            </tr>
            <tr>
                <td>
                    <input label="再次输入" type="text" class="easyui-passwordbox" name="rpwd"
                           style="width: 250px;" labelWidth="90px" prompt="请再次输入密码" data-options="required:'true'"
                           validType="equals['#emp_password']">
                </td>
            </tr>
            <tr>
                <td><input label="联系电话" type="text" class="easyui-textbox" name="tel"
                           value="<shiro:principal property='tel'/>"
                           style="width: 250px;" labelWidth="90px"></td>
            </tr>
            <tr>
                <td><input label="电子邮件" type="text" class="easyui-textbox" name="email"
                           value="<shiro:principal property='email'/>"
                           style="width: 250px;" labelWidth="90px"></td>
            </tr>
        </table>
    </form>

    <div id="emp_diaButtons">
        <a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="save()">确认修改</a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="cancel()">关闭</a>
    </div>
</div>
</body>
</html>
